home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / mc51bugs.zip / Q31556 < prev    next >
Text File  |  1988-07-21  |  2KB  |  69 lines

  1. Q31556 Internal Compiler Error: code.c 1.46, Line 500
  2. C Compiler
  3. 5.00 5.10
  4. MS-DOS
  5.  
  6. Summary:
  7.    The following program will generate the following error when
  8. compiled with the default compile options:
  9.  
  10.      fatal error C1001: Internal Compiler Error
  11.      (compiler file '@(#)code.c:1.46',line 500)
  12.         Contact Microsoft Technical Support
  13.  
  14.    The error is a result of incorrectly declaring an enum type within
  15. the function prototype.
  16.    To work around the problem, declare the enum type before declaring
  17. the function prototype.
  18.    Microsoft has confirmed this to be a problem in Versions 5.00 and
  19. 5.10.
  20.  
  21. More Information:
  22.    The following code example reproduces the error:
  23.  
  24. #include <process.h>
  25. #include <stdlib.h>
  26. #include <string.h>
  27.  
  28. /* Making these declarations will resolve the problem:
  29.  
  30.         enum BEEP { BEEP_silent, BEEP_quiet,
  31.                     BEEP_normal, BEEP_loud } type;
  32.  
  33.         extern void sys_setbeep( BEEP a );
  34. */
  35. extern void sys_setbeep(enum BEEP { BEEP_silent, BEEP_quiet,
  36.                                     BEEP_normal, BEEP_loud } type );
  37.  
  38. extern void setpgm(char *name);
  39. extern void userror(char *cs,...);
  40. extern int  isnewer(char const *file1, char const *file2);
  41.  
  42. #ifndef noassert  /* otherwise get allocation > 64K errors */
  43. main(int argc, char *argv[])
  44. {
  45.     setpgm(argv[0]);
  46.  
  47.     if (argc < 4)
  48.             userror("too few arguements");
  49.  
  50.     switch (isnewer(argv[1], argv[2]))
  51.     {
  52.     case -1:
  53.             userror("%s does not exist",argv[1]);
  54.     case  0:
  55.             return(0);
  56.     case  1:
  57.             execvp(argv[3], &argv[3]);
  58.             userror("unable to execute command '%s' : %s",argv[3],
  59.                     strerror(errno));
  60.             return(3);
  61.     }
  62. }
  63. #endif
  64.  
  65.  
  66.  
  67. Keywords:  buglist5.00 buglist5.10
  68. Updated  88/07/21 03:19
  69.